package com.company.sendemo.basics.yaDesignMode.singleton;

public class SingleTonTest {
//饿汉式
    //1,创建静态的全局唯一的对象
    private static SingleTonTest singleTonTest = new SingleTonTest();
    //2,私有构造方法，不让外部来调用
    private SingleTonTest(){};
    //3,通过自定义的静态方法获取实例
    public static SingleTonTest getSingleTonTest(){
        return singleTonTest;
    }
}
